package cn.tedu.bonfire.common.pojo.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Document(indexName = "account_user")
public class UserAdminSearchPO implements Serializable {
    /*
     * 用户id
     */
    private Long id;

    /*
     * 用户名
     */
    private String username;

    /*
     * 用户昵称
     */
    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String nickname;

    /*
     * 用户电话
     */
    private String phone;

    /*
     * 用户头像
     */
    private String avatar;

    /*
     * 用户状态
     */
    private Integer enable;

    /**
     * 角色
     */
    private String description;

    /*
     * 用户创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm.ss")
    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtCreat;

    /*
     * 用户更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm.ss")
    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime getModfied;
}
